<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
 xmlns:h="http://java.sun.com/jsf/html"
 xmlns:f="http://java.sun.com/jsf/core"
 xmlns:composite="http://java.sun.com/jsf/composite"
 xmlns:c="http://java.sun.com/jsp/jstl/core"
 xmlns:t="http://myfaces.apache.org/tomahawk">

<ui:composition template="../templates/template.xhtml">

<f:loadBundle basename="us.gaaoc.framework.webapp.util.userMessage" var="bundle" />
	<ui:define name="title">
	 	User Profile
	</ui:define>

	<ui:param name="page" value="userProfile" />
	<ui:param name="profile" value="viewProfile" />

	<ui:define name="header">
		<ui:include src="/secure/header.xhtml" />
	</ui:define>

	<ui:define name="pageTitle">
	<script>
		currentmenu="viewProfile";
	</script>
		<h:outputText style="font-weight:normal;"
						value="#{bundle.userprofile}" />		
	</ui:define>

	<ui:define name="body">			
		<h:form id="persondetails">
			<div id="profileContent">
				<div id="userdetails" >
					<div style="position:relative;">
					<div class="content-1">
						<span class="persontitle">#{person.firstName} #{person.lastName}</span><span class="contenttext"> <h:dataTable id="roles" value="#{person.roles}" var="rolesVar"
							 width="40%">
							<h:column>
								<h:outputText value="#{rolesVar.role}" styleClass="fontsubhead"/>
							</h:column>
						</h:dataTable>	</span>
					</div>					
			        <div class="content-2">
			            <div class="content-2-2">42 <br/> Cases</div>
			            <div class="content-2-2"> 5,216 <br/> Filings </div>
			            <div class="content-2-2 last-child"> 1 <br/> Courts</div>
			            <div class="clearfix"></div>
			        </div>
			        <div class="content-3">
			            <h:graphicImage url="/secure/images/profile.png"/><br />
						<h:commandButton value="change" styleClass="buttonClass" />
			        </div>
			        <div class="clearfix"></div>
					</div>
					<div>
					<div class="profileheader" >
						Personal Details
					</div>
					<div class="editdiv">
						<h:commandLink action="#{person.onPersonEdit('true')}">
							<h:outputText value="" styleClass="ui-icon ui-icon-pencil editicon"/> <h:outputText value="Update Details"/>
							<f:ajax render="persondetails"/>	
						</h:commandLink>					
					</div>
					<div class="clearfix"></div>	
					</div>		
				</div>
				<h:panelGrid id="persondetails" width="50%" columns="2" headerClass="profileheader" styleClass="persondetails">
					 <f:facet name="header">
					        <h:outputText value="User Details"/>
					  </f:facet>
					<h:column>
						<h:outputText id="userID" value="User ID: " />
					</h:column>
					<h:column>
						<h:inputText value="#{person.userId}" size="10" rendered="#{person.canEdit}" />
	            		<h:outputText value="#{person.userId}" rendered="#{not person.canEdit}" />						
					</h:column>
					<h:column>
						<h:outputText id="passwor" value="password " />
					</h:column>
					<h:column>
						<h:inputText value="#{person.password}" size="10" rendered="#{person.canEdit}" />
	            		<h:outputText value="#{person.password}" rendered="#{not person.canEdit}" />
					</h:column>
					<h:column>
						<h:outputText id="firstName" value="First Name: " />
					</h:column>
					<h:column>
						<h:inputText value="#{person.firstName}" size="10" rendered="#{person.canEdit}" />
	            		<h:outputText value="#{person.firstName}" rendered="#{not person.canEdit}" />	
					</h:column>
					<h:column>
						<h:outputText id="lastName" value="Last Name: " />
					</h:column>
					<h:column>
						<h:inputText value="#{person.lastName}" size="10" rendered="#{person.canEdit}" />
	            		<h:outputText value="#{person.lastName}" rendered="#{not person.canEdit}" />	
					</h:column>
					<h:column>
						<h:outputText id="emailAddress" value="Email Address : " />
					</h:column>
					<h:column>
						<h:inputText value="#{person.email}" size="10" rendered="#{person.canEdit}" />
	            		<h:outputText value="#{person.email}" rendered="#{not person.canEdit}" />	
					</h:column>
					<h:column>
						<h:outputText id="organizations" value="Filing Court(s): " />
					</h:column>
					<h:column>
						<h:dataTable id="person1" value="#{person.organizations}"
							var="rowVar2">
							<h:column>
								<h:outputText value="#{rowVar2.court.name}" />
							</h:column>
						</h:dataTable>
					</h:column>
					<h:column> 
						<h:commandButton id="editUserLink" value="Edit" action="#{editUser.editUser}" styleClass="buttonClass" rendered="#{person.canEdit}"/> 
					</h:column>	
			</h:panelGrid>
				
			</div>
		</h:form>
	</ui:define>

</ui:composition>

</html>
